import Taro, { Component } from '@tarojs/taro'
import { View, Text, WebView } from '@tarojs/components'
class WebDetail extends Component {
  constructor(props) {
    super(props)
    this.state = {
        url: '',
        type: 1
    }
  }
  componentWillMount() {}
  componentDidMount() {
    let url = decodeURIComponent(this.$router.params.url);
    let type = decodeURIComponent(this.$router.params.type);

    console.log(url)
    this.setState({
        url,
        type,
    })
  }
  componentWillUnmount() {
      this.setState({
          url: ''
      })
  }
  render() {
    const {url} = this.state
    return (
        // View
      <WebView src={url}  />
    )
  }
}

export default WebDetail